let STATUS_LIST = [];


export const updateStatusList = (newStatusList) => {
  STATUS_LIST = [...newStatusList];
  console.log(STATUS_LIST, 997); 
};


export const getStatusList = () => STATUS_LIST;

const getcolor = (status) => {
  if (status === "WAIT_FINISH" || status === "CANCEL_TO_BE_CONFIRMED") {
    return "WAIT_FINISH";
  } else if (status === "PROCESSING" || status === "REPAIRING") {
    return "PROCESSING";
  } else if (status === "REPAIRED_TO_BE_CONFIRMED") {
    return "REPAIRED_TO_BE_CONFIRMED";
  }
};


export const listFields = {
  title: {
    label: "单据号",
    value: "no",
  },
  children: [
    {
      label: "领用类型",
      value: "pickingType",
      statusList: () => getStatusList(),
      statusColor: getcolor,
    },
    {
      label: "申请人",
      value: "createName",
    },
    {
      label: "创建时间",
      value: "createTime",
    },
  ],
};
